﻿using System;
using System.Collections.Generic;
using System.Text;
using ProtoBuf;
namespace  Model
{
    /// <summary>
    /// 外部消息
    /// 客户端和服务器的消息
    /// </summary>
    
    [ProtoInclude((int)Opcode.C2S_Test,typeof(C2S_Test))]
    [ProtoInclude((int)Opcode.G2D_Test, typeof(G2D_Test))]
    public abstract  partial class ARequest { }

    [ProtoInclude((int)Opcode.S2C_Test,typeof(S2C_Test))]
    [ProtoInclude((int)Opcode.D2G_Test, typeof(D2G_Test))]
    public abstract partial class AResponse { }

    [ProtoContract]
    [Message(Opcode.C2S_Test)]
    public class C2S_Test : ARequest
    {
        [ProtoMember(1)]
        public string Account;

        [ProtoMember(2)]
        public string Password;
    }

    [ProtoContract]
    [Message(Opcode.S2C_Test)]
    public class S2C_Test : AResponse
    {
        [ProtoMember(1)]
        public byte Id;
        [ProtoMember(2)]
        public string Name;
    }


    [ProtoContract]
    [Message(Opcode.G2D_Test)]
    public class G2D_Test : ARequest
    {
        [ProtoMember(1)]
        public byte Id;
    }

    [ProtoContract]
    [Message(Opcode.D2G_Test)]
    public class D2G_Test:AResponse
    {
        [ProtoMember(1)]
        public byte Id;
    }
}
